Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.main
Class OutputFile

    java.lang.Object
      rdlc.main.OutputFile

Direct Known Subclasses:
  OutputFile, OutputFile, OutputFile

    public class OutputFile

extends java.lang.Object

Abstracts an output file for the back end pakages. Handles file creation and parameter storage as well as manifest generation. Also includes some basic methods to output common constructs (eg blank lines).

Version:
  $Revision: 1.6 $
Author:
  Greg Gibeling

Field Summary
`protected java.lang.String` | `author` The author, may be `null`.
`protected java.lang.String` | `description` A description of this file.
`protected java.lang.String` | `fileName` The name of the file we're writing to.
`protected java.io.PrintStream` | `out` The actual output print stream.

Constructor Summary
`protected` | `OutputFile(java.io.File outputPath, java.lang.String _fileName, java.lang.String _author, java.lang.String _description, java.util.List<java.io.File> manifest, Log errorLog)` Full constructor, opens the file and stores the properties given.

Method Summary
`static boolean` | `delete(java.io.File directory)` Recursively delete a directory and all it's contents.
`static java.lang.String` | `escapeQuotes(java.lang.String input)` Escape both quotes and backslashes in the input string.
`static int` | `getCloseSpace(java.lang.String input, int start, int maxLen)` Get the space after the start point, trying to get the maximum string less than the given length.
`static java.lang.String` | `padToTab(int offsetWidth, java.lang.String input, int tabCount)` Pad the given string to the requested number of tabs.
`void` | `printBlankLine()` Print a blank line to this file.
`static void` | `printTableRow(java.io.PrintStream out, java.lang.String lineStart, java.util.List<java.lang.String> data, java.util.List<java.lang.Integer> _widths)` Print a table row given the data at field widths.
`static int` | `stringWidth(java.lang.String input)` Compute the width of the given string in character spaces.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### out

    protected java.io.PrintStream out

  The actual output print stream.

### fileName

    protected java.lang.String fileName

  The name of the file we're writing to.

### author

    protected java.lang.String author

  The author, may be `null`.

### description

    protected java.lang.String description

  A description of this file. May be `null`.

Constructor Detail

### OutputFile

    protected OutputFile(java.io.File outputPath,
                         java.lang.String _fileName,
                         java.lang.String _author,
                         java.lang.String _description,
                         java.util.List<java.io.File> manifest,
                         Log errorLog)

  Full constructor, opens the file and stores the properties given. Note that the file name is both recorded for later use and used in a call to the `PrintStream` to open the proper output file.

  Parameters:
    `outputPath` - The output file path. Will be created if nessecary.
    `_fileName` - The file name to use for this output file.
    `_author` - The author (current RDLC user) or `null`
    `_description` - A description of this file or `null`
    `manifest` - List of File objects to which this output file's `File` is added
    `errorLog` - A list of errors to be reported to the user.

Method Detail

### printBlankLine

    public void printBlankLine()

  Print a blank line to this file.

### padToTab

    public static java.lang.String padToTab(int offsetWidth,
                                            java.lang.String input,
                                            int tabCount)

  Pad the given string to the requested number of tabs. Can also take into account padding which will be added before the given string, which is not actually part of the string.

  Parameters:
    `offsetWidth` - The width in character spaces of the padding not in the input.
    `input` - The input string to pad.
    `tabCount` - The tabstop to which the padded output should reach
  Returns:
    The input string padded with tabs.

### stringWidth

    public static int stringWidth(java.lang.String input)

  Compute the width of the given string in character spaces.

  Parameters:
    `input` - The string to find the width of.
  Returns:
    The width in character spaces of the given string.

### getCloseSpace

    public static int getCloseSpace(java.lang.String input,
                                    int start,
                                    int maxLen)

  Get the space after the start point, trying to get the maximum string less than the given length. Return the length of the string found.

  Parameters:
    `input` - The input string to find spaces in.
    `start` - The position to start from.
    `maxLen` - The maximum length to return.
  Returns:
    The length of the substring.

### printTableRow

    public static void printTableRow(java.io.PrintStream out,
                                     java.lang.String lineStart,
                                     java.util.List<java.lang.String> data,
                                     java.util.List<java.lang.Integer> _widths)

  Print a table row given the data at field widths. This method is static so that it be used to print out command line help. Notice that it also includes a line start parameter which can be used to add a comment mark to each line.

  Parameters:
    `out` - The print stream to print the table row to.
    `lineStart` - A string to add to the start of each line.
    `data` - A list of the data for this row
    `_widths` - A list field widths measured in tabs, if any are not given they will be 1. `_widths[0]` is the offset of the whole line, and the line will be cut off at 80 chars.

### escapeQuotes

    public static java.lang.String escapeQuotes(java.lang.String input)

  Escape both quotes and backslashes in the input string.

  Parameters:
    `input` - The input string to escape.
  Returns:
    An escaped version of the input string.

### delete

    public static boolean delete(java.io.File directory)

  Recursively delete a directory and all it's contents. This is equivalent to "rm -rf *" in UNIX, so it WITH EXTREME CAUTION.

  Parameters:
    `directory` - The directory to empty and then delete.
  Returns:
    `true` on success.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD